<!DOCTYPE html>
<html>
<head>
    <title>物业车位登记</title>
<#include "../../common/common.ftl"/>
    <link rel="stylesheet" href="/style/contractForm.css" media="all">

</head>
<body>
<div class="layui-fluid">
    <form class="layui-form" id="carLotForm">
        <input type="hidden" name="carLotId" value="${(carLot.id)!}"/>
        <div class="layui-card">
            <div class="layui-card-header">一、车位基本信息</div>
            <div class="layui-card-body">
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        项目名称：${(carLot.azProject.projectName)!}
                    </div>
                    <div class="layui-col-xs6">
                        幢号：${(carLot.buildNum)!}
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        户号：${(carLot.houseNumStr)!}
                    </div>
                    <div class="layui-col-xs6">
                        建筑面积：${(carLot.buildArea)!}㎡
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        车位类型：${(carLotTypeMap[carLot.carLotType?c].name)}
                    </div>
                    <div class="layui-col-xs6">
                        车位价格：${(carLot.price)!}元
                    </div>
                </div>

            <#if carLot.houseStatus==2 && carLot.chooseHouseDate??>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        选房时间：${carLot.chooseHouseDate?string('yyyy-MM-dd')}
                    </div>
                    <div class="layui-col-xs6">
                        选房操作人：${(carLot.choosePerson)!}
                    </div>
                </div>
            </#if>
                <div class="layui-form-item">
                    <div class="layui-col-xs12">
                        备&#160;&#160;&#160;&#160;&#160;&#160;&#160;注：${(carLot.memo)!}
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-card">
            <div class="layui-card-header">二、产权人信息</div>
            <div class="layui-card-body">
            <#if (buyHousePersonList?size>0)>
                <#list buyHousePersonList as buyHousePerson>
                    <div class="layui-form-item">
                        <div class="layui-col-xs6">
                            产权人姓名：${(buyHousePerson.name)!}
                        </div>
                        <div class="layui-col-xs6">
                            身份证号：${(buyHousePerson.idCard)!}
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-col-xs6">
                            联系方式：${(buyHousePerson.tel)!}
                        </div>
                        <div class="layui-col-xs6">
                            备&#160;&#160;&#160;&#160;&#160;&#160;&#160;注：${(buyHousePerson.memo)!}
                        </div>
                    </div>
                </#list>
            </#if>
            </div>
        </div>
        <div class="layui-card">

            <div class="layui-card-header">三、物业数据管理</div>
            <div class="layui-card-body">
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">交房状态：</label>
                            <div class="layui-input-blockRight">
                                <input type="radio"
                                       <#if (!carLot.takeHouseStatus?? || carLot.takeHouseStatus == 1)>checked</#if>
                                       name="takeHouseStatus" value="1" title="未交房"/>
                                <input type="radio"
                                       <#if (carLot.takeHouseStatus?? && carLot.takeHouseStatus == 2)>checked</#if>
                                       name="takeHouseStatus" value="2" title="已交房"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">交房时间：</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" id="takeHouseDate"
                                       name="takeHouseDate" value="${(carLot.takeHouseDate?string('yyyy-MM-dd'))!}">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">办证状态：</label>
                            <div class="layui-input-blockRight">
                                <input type="radio"
                                       <#if (!carLot.bzStatus?? || carLot.bzStatus == 1)>checked</#if>
                                       name="bzStatus" value="1" title="未办证"/>
                                <input type="radio"
                                       <#if (carLot.bzStatus?? && carLot.bzStatus == 2)>checked</#if>
                                       name="bzStatus" value="2" title="已办证"/>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-inline">
                            <label class="layui-form-labelLong">办证时间：</label>
                            <div class="layui-input-blockRight">
                                <input type="text" class="layui-input" id="bzDate"
                                       name="bzDate" value="${(carLot.bzDate?string('yyyy-MM-dd'))!}">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <button style="display: none;" class="layui-btn" id="submitBtn" name="submitBtn" lay-submit=""
                lay-filter="submit">立即提交
        </button>
    </form>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['form', 'jmdf', 'dataDict', 'element', 'laydate', 'verify'], function () {
        var form = layui.form, $ = layui.jquery, dataDict = layui.dataDict, jmdf = layui.jmdf, laydate = layui.laydate,
                verify = layui.verify, parentIndex = parent.layer.getFrameIndex(window.name);

        laydate.render({
            elem: '#takeHouseDate'
            , type: 'date'
            , format: 'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#bzDate'
            , type: 'date'
            , format: 'yyyy-MM-dd'
        });
        //监听提交
        form.on('submit(submit)', function (data) {
            $.ajax({
                url: 'wyCarLotSave',
                type: 'post',
                data: $("#carLotForm").serialize(),//当前容器的全部表单字段，名值对形式：{name: value}
                async: false,
                success: function (data) {
                    if (data.code == "0001") {
                        layer.alert(data.message);
                        parent.loadData();
                        parent.layer.close(parentIndex);
                    } else {
                        layer.msg(data.message, {anim: 6, icon: 2, time: 3000});
                    }
                }
            });
            return false;
        });
    });
</script>
</body>
</html>